package com.grass.p019lv;

import android.content.Context;
import android.webkit.JavascriptInterface;
import com.alibaba.android.arouter.launcher.ARouter;
import com.androidx.p013lv.base.APPLink;
import com.androidx.p013lv.base.Constance;
import com.androidx.p013lv.base.interfaces.Key;
import com.androidx.p013lv.base.utils.ActivityUtil;
import com.grass.p019lv.activity.MainActivity;
import com.just.agentweb.AgentWeb;

/* renamed from: com.grass.lv.AndroidInterface */
public class AndroidInterface {
    private AgentWeb agent;
    private APPLink appLink;
    private Context context;

    @JavascriptInterface
    public String getAndroid() {
        return "Android";
    }

    public AndroidInterface(AgentWeb agentWeb, Context context2) {
        this.agent = agentWeb;
        this.context = context2;
    }

    @JavascriptInterface
    public void startHome() {
        ActivityUtil.getInstance().finishAllActivityExcept(MainActivity.class);
    }

    @JavascriptInterface
    public void startVip() {
        ARouter.getInstance().build(Constance.VIP_CENTER_ACTIVITY).withString(Key.BACK_TITLE, "返回").navigation();
    }

    @JavascriptInterface
    public void startShare() {
        ARouter.getInstance().build(Constance.SHARE_ACTIVITY).navigation();
    }

    @JavascriptInterface
    public void startOfficial() {
        ARouter.getInstance().build(Constance.OFFICIAL_ACTIVITY).withString(Key.BACK_TITLE, "返回").navigation();
    }

    @JavascriptInterface
    public void startAddGroup() {
        ARouter.getInstance().build(Constance.ADD_GROUP_ACTIVITY).withString(Key.BACK_TITLE, "返回").navigation();
    }

    @JavascriptInterface
    public void startJumpUrl(String str) {
        if (this.appLink == null) {
            this.appLink = new APPLink(this.context);
        }
        this.appLink.urlLink(str);
    }
}
